const Sequelize = require('sequelize');
//导入配置文件
const db = require('../config/sequelizeDB');
const Employee = db.define('register_info', {
  register_id: {  //属性名可以和列名相同,也可以不同
    type: Sequelize.BIGINT, //属性的数据类型,对应的是列的数据类型
    primaryKey: true, //表示该属性对应的是表的主键列
    autoIncrement: true, //设置为自增
    field: '挂号单号' //映射列名
  },
  self_name: {
    type: Sequelize.STRING(255),
    allowNull: false, //表示不允许为空
    field: '本人姓名'
  },
  self_id: {
    type: Sequelize.INTEGER(11),
    allowNull: false,
    field: '本人ID'
  },
  doctor_name: {
    type: Sequelize.STRING(255),
    allowNull: false,
    field: '医生姓名'
  },
  doctor_id: {
    type: Sequelize.INTEGER(13),
    allowNull: false,
    field: '医生ID'
  },
  register_date: {
    type: Sequelize.DATE,
    allowNull: false,
    field: '就诊日期'
  },
  register_time: {
    type: Sequelize.TIME,
    allowNull: false,
    field: '就诊时段'
  },
  register_department: {
    type: Sequelize.STRING(255),
    allowNull: false,
    field: '挂号科室'
  },
  register_position: {
    type: Sequelize.STRING(255),
    allowNull: false,
    field: '就诊诊室'
  },
  Register_num: {
    type: Sequelize.INTEGER(4),
    allowNull: false,
    field: '排号'
  },
  Waiting: {
    type: Sequelize.INTEGER(4),
    allowNull: false,
    field: '仍需等待几位'
  },
  register_status: {
    type: Sequelize.TINYINT,
    allowNull: false,
    field: `0: "待就诊",
    1: "未就诊",
    2: "治疗中",
    3: "已完成",
    `
  },
  medicine: {
    type: Sequelize.STRING(255),
    allowNull: false,
    field: '治疗药品'
  },
  symptom: {
    type: Sequelize.STRING(255),
    allowNull: false,
    field: '症状'
  },
  check_result: {
    type: Sequelize.STRING(255),
    allowNull: false,
    field: '检查结果'
  },
  infuse: {
    type: Sequelize.STRING(255),
    allowNull: false,
    field: '输液'
  },
  checkProject: {
    type: Sequelize.STRING(255),
    allowNull: false,
    field: '检查项目'
  }
}, {
  freezeTableName: true, //映射表名的设置：true表示使用用户给定的表名,false表示MySQL自动生成表名(为类名后加s)
  timestamps: false //是否自动生成时间戳列(createAt列、updateAt列),false表示不生成
});

module.exports = Employee;
